﻿

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using WangCon;
using HShowImgContMess;
using System.Drawing;
using WangCon.Op;

namespace WangCon
{

    public partial class FormMain : Form
    {

        #region Func

        //Dll
        [DllImport("wangConAlg.dll", CharSet = CharSet.Ansi)]
        public static extern unsafe int deletePt(ref IntPtr pt);

        [DllImport("wangConAlg.dll", CharSet = CharSet.Ansi)]
        public static extern int threshold(Int32[] data, int img_w, int img_h,
            Int32[] reg, int min, int max);

        [DllImport("wangConAlg.dll", CharSet = CharSet.Ansi)]
        public static extern int mea_line(Int32[] data, int img_w, int img_h,
            RoiRect2 rect2, int numMes, int small_len2,
            int thres, int sigma, int trans, int select, ref Line line);

        [DllImport("wangConAlg.dll", CharSet = CharSet.Ansi)]
        public static extern int fit_plane_3d(Point3D[] pts, int nSize, ref Plane3D plane3D);

        [DllImport("wangConAlg.dll", CharSet = CharSet.Ansi)]
        public static extern int dist_pt_2_plane_3d(Point3D pt, Plane3D plane3D, ref double dist);

        //区域中值    
        [DllImport("wangConAlg.dll", CharSet = CharSet.Ansi)]
        public static extern int get_pt_med(Int32[] data, int width, int height,
           ref RoiRect1 rect1, ref int value);

        [DllImport("wangConAlg.dll", CharSet = CharSet.Ansi)]
        public static extern int Test(Int32[] data, int count);


        #endregion Func


    }


}